/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
*
*
* Authors:                  zhoujian
* Email:            343600434@qq.com
* Date:         Jan-25-2024 11:03:03
*
*/


#ifndef __uart_parse_H__
#define __uart_parse_H__


#include "gd32l23x.h"


#ifdef __cplusplus
extern "C" {
#endif

//#define ENABLE_JIHUO_FUNC

#define LOCK_IMMEDIATELY

#define BLE_LEN 32
#define TEL_LEN 27


typedef struct phone_t {
    int update;
    char blue_buf[BLE_LEN];
    int tel_update;
    char tel_state;
    char tel_num[TEL_LEN];
} PHONE_T;
extern PHONE_T phone_t;
//extern uint8_t bk3288_hfp_connect;
//extern uint8_t music_on;
//extern uint8_t music_show_view;
#define MUSIC_INFO 0xF0
#define PHONE_INFO 0xF1
#define GUIDE_INFO 0xF2
#define TIMESTAMP_INFO 0xF3

typedef struct music_t {
    int update;
    char blue_buf[256];
    int len;
} MUSIC_T;
extern MUSIC_T music_t;


enum {
    LEFT = 0,
    RIGHT,
    LEFT_FRONT,
    RIGHT_FRONT,
    LEFT_BACK,
    RIGHT_BACK,
    TURN_LEFT,
    STRAIT,
    ARRIVE_POINT,
    ENTER_CIRCLE,
    ARRIVE_END,
    ANTEROGRADE,//shunxing

};
extern uint8_t guide_update;
extern uint8_t guide_connected;
extern uint8_t guide_off;
extern uint8_t guidance_units, guide;
extern uint32_t Guide_distance;
extern uint8_t jihuo_t[7];
extern uint32_t lock_time;
void Guide_Data_Deal(uint8_t* p_buf);

void parse_data(uint8_t* buf, int total_len);
void uart_recv(void);

void send_to_bk3288(char* buf, int len);
void uart0_send(char* buf, int len);






#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
class uart_parse
{

public:
    uart_parse();
    ~uart_parse();

};
#endif



#endif
